/*
    * Copyright (c) 2024 Hunan OpenValley Digital Industry Development Co., Ltd.
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    *     http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
 */

#ifndef OHOS_FILE_SHARE_LOG_H
#define OHOS_FILE_SHARE_LOG_H

#include "hilog/log.h"
#include <cinttypes>

namespace OHOS {
namespace FileShare {
namespace {
constexpr uint32_t HILOG_LOG_DOMAIN = 0xD002910;
} // namespace
#ifndef FUNC_FMT
#define FUNC_FMT "in %{public}s "
#endif

#ifndef FUNC_INFO
#define FUNC_INFO __FUNCTION__
#endif

const HiviewDFX::HiLogLabel LABEL = { LOG_CORE, HILOG_LOG_DOMAIN, "FileShare" };

#define LOGD(fmt, ...) do { \
    OHOS::HiviewDFX::HiLog::Debug(LABEL, FUNC_FMT fmt, FUNC_INFO, ##__VA_ARGS__); \
} while (0)
#define LOGI(fmt, ...) do { \
    OHOS::HiviewDFX::HiLog::Info(LABEL, FUNC_FMT fmt, FUNC_INFO, ##__VA_ARGS__); \
} while (0)
#define LOGW(fmt, ...) do { \
    OHOS::HiviewDFX::HiLog::Warn(LABEL, FUNC_FMT fmt, FUNC_INFO, ##__VA_ARGS__); \
} while (0)
#define LOGE(fmt, ...) do { \
    OHOS::HiviewDFX::HiLog::Error(LABEL, FUNC_FMT fmt, FUNC_INFO, ##__VA_ARGS__); \
} while (0)
} // namespace FileShare
} // namespace OHOS
#endif // OHOS_FILE_SHARE_LOG_H
